home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.cyberramp.net!news
- From: sinan@cyberramp.net (John Noland)
- Newsgroups: comp.lang.c
- Subject: Re: Help With Pointers
- Date: 27 Feb 1996 01:47:02 GMT
- Organization: Prose Software
- Message-ID: <4gtnqm$qn2@newshost.cyberramp.net>
- References: <4g67cj$6cv@hobbes.compusult.nf.ca> <4ggvnq$2bt@newshost.cyberramp.net> <danpop.825077898@rscernix>
- NNTP-Posting-Host: ramp3-15.cyberramp.net
- X-Newsreader: WinVN 0.99.5
-
- In article <danpop.825077898@rscernix>, danpop@mail.cern.ch says...
- >>char SGI_source[4];
- >>union {
- >> char d1[4];
- >> float d2;
- >>} dest;
- >>
- >>dest.d1[1] = SGI_source[2];
- >>dest.d2[2] = SGI_source[1];
- > ^^
- > ?? Should be d1
- >>
- >>or however the byte rotation needs to be done.
- >
- >Using a union for this purpose is a bit of overkill (and, as you just
- >proved, error prone :-), a pointer is all that is needed:
-
- YIKES!! I knew there was a reason to be apprehensive about posting that.
- A disengagement error if I ever saw one. [disengage brain...type code...
- let the compiler do the dirty work...wait a minute...something's worng$#%$##]
- Sorry. Thanks Dan.
-
- -John
-
-